/**
 * @brief   根据位置输入切换磁场输出
 */

#include "six_step.h"


static void actions_of_sector_1(const six_step_t *six_step);

void change_step(const six_step_t *six_step)
{


    switch (six_step->sector)
    {
    case sector_1:
        if (six_step->direction == clock_wise)
        {
            actions_of_sector_1(six_step);
        }
        else
        {

        }
        break;
    case sector_2:
        break;
    case sector_3:
        break;
    case sector_4:
        break;
    case sector_5:
        break;
    case sector_6:
        break;
    default:
        break;
    }
}


static void actions_of_sector_1(const six_step_t *six_step)
{
    const unsigned short temp_duty = (unsigned short)(six_step->target_speed/six_step->motor.base_speed);

    if (six_step->mode == h_on_l_pwm)
    {
        open_a_above_bridge();
        open_c_below_by_duty(temp_duty);
    }
    else if (six_step->mode == h_pwm_l_on)
    {

    }
    else if (six_step->mode == h_pwm_l_pwm)
    {

    }
}
